package com.shhm.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.shhm.business.dto.request.OrderSearchReq;
import com.shhm.common.dto.response.business.OrderVO;
import com.shhm.common.entity.common.OrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/9/15 上午11:58
 */
@Mapper
public interface OrderMapper extends BaseMapper<OrderEntity> {
    PageDTO<OrderVO> customSelectPage(PageDTO<OrderEntity> userPage);

    PageDTO<OrderVO> selectByDynamicConditions(PageDTO<OrderEntity> page,@Param("entity") OrderSearchReq entity);

    @Update("UPDATE tb_order tbo JOIN tb_product tp ON tp.product_id = tbo.product_id SET tbo.evaluationed = 1 WHERE tp.product_num = #{productNum}")
    int evaluationOrder(String productNum);
}
